home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-10-07 | 4.8 KB | 239 lines | [TEXT/CWIE] |
- /*==============================================================================
- Project: POV
-
- Version: 3
-
- File: sysMacPict.c
-
- Description:
- This module contains the code to read/write Mac PICT image files.
- (System-dependent image_map file format read/write routines - for Macintosh PICT)
- ------------------------------------------------------------------------------
- Author:
- Eduard [esp] Schwan
- ------------------------------------------------------------------------------
- from Persistence of Vision(tm) Ray Tracer
- Copyright 1996 Persistence of Vision Team
- ------------------------------------------------------------------------------
- NOTICE: This source code file is provided so that users may experiment
- with enhancements to POV-Ray and to port the software to platforms other
- than those supported by the POV-Ray Team. There are strict rules under
- which you are permitted to use this file. The rules are in the file
- named POVLEGAL.DOC which should be distributed with this file. If
- POVLEGAL.DOC is not available or for more info please contact the POV-Ray
- Team Coordinator by leaving a message in CompuServe's Graphics Developer's
- Forum. The latest version of POV-Ray may be found there as well.
-
- This program is based on the popular DKB raytracer version 2.12.
- DKBTrace was originally written by David K. Buck.
- DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
- ------------------------------------------------------------------------------
- Change History:
- 960123 [esp] Created
- ==============================================================================*/
-
- #undef POV_COMMENTS // turn on for internal comment stamping
-
- #include "frame.h"
- #include "povproto.h"
- #include "povray.h"
- #include "optout.h"
- #include "sysMacPict.h"
-
- /*****************************************************************************
- *
- * FUNCTION
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * DESCRIPTION
- *
- * CHANGES
- *
- ******************************************************************************/
-
- static int MacPICT_Line_Number;
-
- FILE_HANDLE *Get_MacPICT_File_Handle()
- {
- FILE_HANDLE *handle;
-
- handle = (FILE_HANDLE *) POV_MALLOC(sizeof(FILE_HANDLE), "MacPICT file handle") ;
-
- handle->Open_File_p = Open_MacPICT_File;
- handle->Write_Line_p = Write_MacPICT_Line;
- handle->Read_Line_p = Read_MacPICT_Line;
- handle->Read_Image_p = Read_MacPICT_Image;
- handle->Close_File_p = Close_MacPICT_File;
-
- handle->file = NULL;
- handle->buffer = NULL;
- handle->buffer_size = 0;
-
- return (handle);
- }
-
- /*****************************************************************************
- *
- * FUNCTION
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * DESCRIPTION
- *
- * CHANGES
- *
- ******************************************************************************/
-
- int Open_MacPICT_File(handle, name, width, height, buffer_size, mode)
- FILE_HANDLE *handle;
- char *name;
- int *width;
- int *height;
- int buffer_size;
- int mode;
- {
- printf("Sorry, opening Mac PICT files is not yet implemented.\n");
- }
-
- /*****************************************************************************
- *
- * FUNCTION
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * DESCRIPTION
- *
- * CHANGES
- *
- ******************************************************************************/
-
- void Write_MacPICT_Line(handle, line_data, line_number)
- FILE_HANDLE *handle;
- COLOUR *line_data;
- int line_number;
- {
- }
-
- /*****************************************************************************
- *
- * FUNCTION
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * DESCRIPTION
- *
- * CHANGES
- *
- ******************************************************************************/
-
- int Read_MacPICT_Line(handle, line_data, line_number)
- FILE_HANDLE *handle;
- COLOUR *line_data;
- int *line_number;
- {
- }
-
- /*****************************************************************************
- *
- * FUNCTION
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * DESCRIPTION
- *
- * CHANGES
- *
- ******************************************************************************/
-
- void Close_MacPICT_File(handle)
- FILE_HANDLE *handle;
- {
- if (handle == NULL)
- return;
-
- if (handle->file)
- {
- fflush(handle->file);
- fclose(handle->file);
- }
-
- if (handle->buffer != NULL)
- {
- POV_FREE(handle->buffer);
- }
-
- handle->file = NULL;
- handle->buffer = NULL;
- }
-
- /*****************************************************************************
- *
- * FUNCTION
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * DESCRIPTION
- *
- * CHANGES
- *
- ******************************************************************************/
-
- void Read_MacPICT_Image(Image, name)
- IMAGE *Image;
- char *name;
- {
- char type;
- int width, height;
- int depth;
- char input;
- char junk[512];
- int x, y;
- int data;
- IMAGE_LINE *line_data;
- FILE *infile;
-
- if ((infile = Locate_File(name, READ_FILE_STRING, ".pict", ".PICT", true)) == NULL)
- {
- Error("Error opening MacPICT image %s.\n", name);
- }
-
- fclose(infile);
- }
-